package com.wisdytech.common.bean;

import java.io.Serializable;

/**
 * 
 * <p>ClassName: StandardResult</p>
 * <p>Description: 标准返回值对象</p>
 * <p>Author: dailibo</p>
 * <p>Date: 2017-9-13</p>
 */
public class StandardResult implements Serializable{

    /**
     * <p>Field serialVersionUID: TODO</p>
     */
    private static final long serialVersionUID = -8732188639674054927L;
    
    /**是否成功*/
    private boolean result;
    /**提示信息*/
    private String message;
    /**返回数据*/
    private Object data;
    
    public StandardResult(){
        
    }
    public StandardResult(boolean result){
        this.result = result;
    }
    
    public StandardResult(boolean result,String message){
        this.result = result;
        this.message=message;
    }
    
    public StandardResult(boolean result,String message,Object data){
        this.message=message;
        this.result = result;
        this.data=data;
    }
    
    public static StandardResult getFailResult(){
        return new StandardResult(false);
    }
    
    public static StandardResult getFailResult(String message){
        return new StandardResult(false,message);
    }
    
    public static StandardResult getFailResult(String message,Object data){
        return new StandardResult(false,message,data);
    }
    
    public static StandardResult getSuccessResult(){
        return new StandardResult(true);
    }
    public static StandardResult getSuccessResult(Object data){
        return new StandardResult(true,"",data);
    }

    public static StandardResult getSuccessResult(String message,Object data){
        return new StandardResult(true,message,data);
    }
    
    
    public boolean getResult() {
        return result;
    }
    public void setResult(boolean result) {
        this.result = result;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    
    
    
}
